<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>分配角色</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="${path}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${path}/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="${path}/css/plugins/dataTables/dataTables.bootstrap.css"
          rel="stylesheet">
    <link href="${path}/css/animate.css" rel="stylesheet">
    <link href="${path}/css/style.css?v=4.1.0" rel="stylesheet">

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form action="${path}/addDistriRole"  method="post">
                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                            <tr>
                                <th><input type="checkbox" onclick="choseAll()">默认(员工)
                                    <input type="hidden" name="empId" value="${empId}">
                                </th>
                                <th>角色名称</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${listerd}" var="erd">
                                <tr class="gradeA">
                                    <td><input type="radio" name="rolecheck" <c:if test="${erd.check ==true}">checked</c:if> value="${erd.role.id}" ></td>
                                    <td>${erd.role.name}</td>
                                </tr>
                            </c:forEach>
                            <tr>
                                <td colspan="2">
                                    <button class="btn btn-success" type="submit">添&nbsp;&nbsp;加</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="${path}/js/jquery.min.js?v=2.1.4"></script>
<script src="${path}/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${path}/js/plugins/jeditable/jquery.jeditable.js"></script>

<!-- Data Tables -->
<script src="${path}/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="${path}/js/plugins/dataTables/dataTables.bootstrap.js"></script>

<!-- 自定义js -->
<script src="${path}/js/content.js?v=1.0.0"></script>
<script src="${path}/js/plugins/layer/layer.min.js"></script>
</body>
<script type="text/javascript">
    function choseAll(){
        var checkAll = document.getElementsByName("rolecheck");
        for (var i = 0; i <checkAll.length ; i++) {
            checkAll[i].checked=!checkAll[i].checked;
        }
    }

    /*function myclose(){
        parent.layer.closeAll();
    }*/
</script>
</html>
